import Mock from 'mockjs2'
import { builder } from '../util'

const titles = [
  '为什么要注册商标',
  '注册商标多少钱',
  '注册商标的优势是什么',
  '注册商标的流程',
  '注册商标有什么用',
  '注册专利为什么越早越好',
  '注册专利为什么要选择代理机构',
  '版权注册的费用是多少'
]

const article = () => {
  const result = []
  for (let i = 0; i < 7; i++) {
    const tmpKey = i + 1
    result.push({
      id: tmpKey,
      title: titles[i],
      content: '文章内容',
      visited: Mock.mock('@integer(1, 999)'),
      src: 'http://www.baidu.com'
    })
  }
  return builder({
    data: result
  })
}

Mock.mock(/\/list\/article/, 'get', article)
